<h1>Estabelecimentos</h1>

<?php echo $this->Html->link('Adicionar Estabelecimento', array('controller' => 'establishments', 'action' => 'add')); ?>

<p><?php echo '<strong>Total de Estabelecimentos Cadastrados: </strong>' . sizeof($establishments); ?></p>

<table>
	<tr>
		<th>Id</th>
		<th>Interesse</th>
		<th>Nome</th>
		<th>Logo</th>
		<th>Slogan</th>
		<th>Descrição</th>
		<th>Endereço</th>
		<th>Cidade</th>
		<th>Estado</th>
		<th>País</th>
		<th>Website</th>
		<th>Telefone 1</th>
		<th>Telefone 2</th>		
		<th>Data de Criação</th>
		<th>Data de Modificação</th>							
	</tr>
	
	<?php foreach ($establishments as $establishment): ?>
	
	<tr>
		<td><?php echo $establishment['Establishment']['id']; ?></td>
		<td><?php echo $establishment['Interest']['name']; ?></td>
		<td><?php echo $this->Html->link($establishment['Establishment']['name'], array('controller' => 'establishments', 'action' => 'view', $establishment['Establishment']['id'])); ?></td>
		<td><img src="data:image/png;base64,<?php echo $establishment['Establishment']['logo']; ?>" alt="Establishment Logo" /></td>
		<td><?php echo $establishment['Establishment']['slogan']; ?></td>
		<td><?php echo $establishment['Establishment']['description']; ?></td>
		<td><?php echo $establishment['Establishment']['address']; ?></td>
		<td><?php echo $establishment['Establishment']['city']; ?></td>
		<td><?php echo $establishment['Establishment']['state']; ?></td>
		<td><?php echo $establishment['Establishment']['country']; ?></td>
		<td><?php echo $establishment['Establishment']['website']; ?></td>
		<td><?php echo $establishment['Establishment']['phone1']; ?></td>
		<td><?php echo $establishment['Establishment']['phone2']; ?></td>
		<td><?php echo $establishment['Establishment']['created']; ?></td>
		<td><?php echo $establishment['Establishment']['modified']; ?></td>					
		<td><?php echo $this->Html->link('Editar', array('action' => 'edit', $establishment['Establishment']['id'])); ?></td>
		<td><?php echo $this->Form->postLink('Apagar', array('action' => 'delete', $establishment['Establishment']['id']), array('confirm' => 'Tem certeza de que deseja apagar o estabelecimento?')); ?></td>
	</tr>
	
	<?php endforeach; ?>
</table>	 
	